package com.kmsoft.gateway.facade;

import com.kmsoft.gateway.application.GatewayConfigApplicationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
public class GatewayConfigFacade {

    @Resource
    private GatewayConfigApplicationService gatewayConfigApplicationService;
    @Value("${km.test:}")
    private String test;

    @GetMapping("/refreshRoute")
    public String routeRefresh() {
        log.info("刷新路由开始");
        gatewayConfigApplicationService.refreshRoute();
        log.info("刷新路由成功");
        return "success";
    }

    @GetMapping("/test")
    public String test() {
        return test;
    }
}
